﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="newswriting.aspx.cs" Inherits="Sys_newswriting" validateRequest="false"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link rel="stylesheet" type="text/css" href="../js/themes/default/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="../CSS/Style.css"/>
    <script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="../js/jquery.easyui.min.js"></script>  
	<script type="text/javascript" src="../xheditor/xheditor-zh-cn.min.js"></script>
<script type="text/javascript"> 
function check()
{
      if ($.trim($('#ddlNewstype').val())=="请选择") 
     {
     alert("请选择公告类型！"); 
     return false;
     }
    else if ($.trim($('#txtTopic').val())=="") 
     {
     alert("公告标题不可为空！"); 
     return false;
     }
    else if($.trim($('#txtContent').val())=="")
    {
    alert("公告内容不可为空！"); 
    return false;
    } 
}
function checkLength(){
    var curLength = document.getElementById("txtTopic").value.length;
    if (curLength>35){
        alert("超过字数限制，多出的字将被截断！" );
        document.getElementById("txtTopic").value = document.getElementById("txtTopic").value.substr(0,35);
        curLength = 35;
    }
	document.getElementById("num").innerHTML = 35-document.getElementById("txtTopic").value.length;
}
window.onload = function(){
	if(/msie/i.test(navigator.userAgent)){
		document.getElementById("txtTopic").onpropertychange = checkLength;
	} else {
		document.getElementById("txtTopic").addEventListener("input",checkLength,false);
	}
}
function btnReset_onclick()
{
document.getElementById("txtTopic").value="";
document.getElementById("txtContent").innerHTML="";
}
</script> 
<script type="text/javascript">
$(function showeditor(){
$('#txtContent').xheditor({skin:'vista',upLinkUrl:'../Common/Upload.aspx',upLinkExt:'zip,rar,7z,doc,docx,xls,xlsx,ppt,pptx,txt',upImgUrl:'../Common/Upload.aspx',upFlashUrl:'../Common/Upload.aspx',upMediaUrl:'../Common/Upload.aspx'});
}); 
</script>
</head>
<body>
    <form id="form1" runat="server">
    
           <div style="background:#efefef;width:100%;">
		<a href="newswriting.aspx" target="mainwin" class="easyui-linkbutton" plain="true">撰写公告</a>
		|
		<a href="newsmanager.aspx" target="mainwin" class="easyui-linkbutton" plain="true">编辑公告</a>
        </div>	 
        <table style="width: 782px; height: 1px" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td style="width: 14px; height: 5px;">
                </td>
                <td style="height: 5px;" colspan="4">
                </td>
            </tr>
            <tr>
                <td style="width: 14px;" rowspan="7">
                </td>
                <td colspan="4">
                    公告类型：<asp:DropDownList ID="ddlNewstype" runat="server" Width="120px" AppendDataBoundItems="True">
                        <asp:ListItem>请选择</asp:ListItem>
                        <asp:ListItem>申报</asp:ListItem>
                        <asp:ListItem>评审</asp:ListItem>
                        <asp:ListItem>其他</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp;
                    <asp:CheckBox ID="ckbUpdatetime" runat="server" Text="将发表时间更新为当前时间" Visible="False" />
                    <asp:Label ID="lblOldtime" runat="server" Visible="False"></asp:Label></td>
            </tr>
            <tr>
                <td style="height: 5px;" colspan="4">
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    公告主题：<span
                        style="font-size: 10pt; color: #6699cc"><asp:TextBox ID="txtTopic" runat="server" Width="466px" BorderColor="#C0C0FF" BorderStyle="Solid"></asp:TextBox>主题还能输入<span id="num" style="font-size: 11pt; color: #ff0000">35</span>字</span></td>
            </tr>
            <tr>
                <td style="height: 10px;" colspan="4">
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <asp:TextBox ID="txtContent"  class="xheditor {skin:'vista',upLinkUrl:'../Common/Upload.aspx',upLinkExt:'zip,rar,7z,doc,docx,xls,xlsx,ppt,pptx,txt',upImgUrl:'../Common/Upload.aspx',upFlashUrl:'../Common/Upload.aspx',upMediaUrl:'../Common/Upload.aspx'}"  runat="server" Height="350px" TextMode="MultiLine" Width="750px"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="height: 5px;" colspan="4">
                </td>
            </tr>
            <tr>
                <td style="height: 22px;" align="center" colspan="4">
                    <asp:Button ID="btnSubmit" runat="server" CssClass="btn-dy-blue" Text="提交" OnClick="btnSubmit_Click" OnClientClick="return check();" />
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
